<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="">
        <table>
            <tr>
                <td>手机号</td>
                <td><input type="text"  class="mobile"></td>
                <td></td>
            </tr>
            <tr>
                <td>邮箱</td>
                <td><input type="text"  class="email"></td>
                <td></td>
            </tr>
            <tr>
                <td>密码</td>
                <td><input type="text"  class="pwd"></td>
                <td></td>
            </tr>
            <tr>
                <td colspan="3">
                    <input type="button" value="注册" disabled class="regist">
                </td>
            </tr>
        </table>
    </form>

    <SCRipt>
        // 验证手机号邮箱密码
      var flag1=flag2=flag3=false
      document.querySelector('.mobile').onblur=function(){
        var value=this.value
        if(/^1[356789]\d{9}$/.test(value)){
            this.parentElement.nextElementSibling.innerHTML=`<span style='color:pink'>√</span>`
            flag1=true
        }else{
            this.parentElement.nextElementSibling.innerHTML=`<span style='color:red'>×</span>`
            flag1=false
        }
        abc()
      } 

      document.querySelector('.email').onblur=function(){
        var value=this.value
        if(/\w{3,24}@(163|qq)\.(com|cn)$/.test(value)){
            this.parentElement.nextElementSibling.innerHTML=`<span style='color:pink'>√</span>`
            flag2=true
        }else{
            this.parentElement.nextElementSibling.innerHTML=`<span style='color:red'>×</span>`
            flag2=false
        }
        abc()
      }
      document.querySelector('.pwd').onblur=function(){
        if(this.value.length>=3){
            this.parentElement.nextElementSibling.innerHTML=`<span style='color:pink'>√</span>`
            flag3=true
        }else{
            this.parentElement.nextElementSibling.innerHTML=`<span style='color:red'>×</span>`
            flag3=false
        }
        abc()
      }

      function abc(){
        var btn = document.querySelector('.regist');
        (flag3 && flag2 && flag1) ? (btn.disabled = false) :(btn.disabled = true)
    }
    </SCRipt>
</body>
</html>